﻿// Jinx AJAX Framework
// Copyright (C) 2008 Blake Hegerle
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System.Collections.Generic;
using Formality.Game;

namespace Formality.Game
{
    public class TransientPlayer<T> : IPlayer<T>
    {
        private readonly List<string> Submissions;

        public TransientPlayer(string Name)
        {
            this.Name = Name;
            Submissions = new List<string>();
        }

        #region IPlayer<T> Members

        public string ProblemId { get; private set; }

        public string Name { get; private set; }

        public IEnumerable<string> CurrentProblemSubmissions
        {
            get { return Submissions; }
        }

        public IEnumerable<string> ProblemSubmissions(string IgnoredProblemId)
        {
            yield break;
        }

        public void AddSubmission(Sentence<T> Submission, int Order)
        {
            Submissions.Add(Submission.Item.ToString());
        }

        public void ChangeGoal(string NewProblemId)
        {
            ProblemId = NewProblemId;
        }

        #endregion
    }
}